package com.mebs.model.reports;

import org.jt.jet.content.JetNamedObject;

/**
 * User: epb
 * Date: 10.02.2009
 * Time: 15:48:26
 */
public enum ReportType implements JetNamedObject {
	COMMERCIAL_INVOICE(1, "commercial_invoice", "Commercial Invoice", "CI", true, false),
	PACKING_LIST(2, "packing_list_report", "Packing List", "PL", true, true),
	VALUED_INVENTORY(3, "valued_inventory", "Valued Inventory", "VI", true, true),
	ON_HAND_XLS_REPORT(4, "xls_report", "On-Hand report", "XLS"),
	M_REPORT(5, "pallet_report", "Pallet # Report", "XLS"),
	OPEN_SHIPMENT_REPORT(6, "open_shipment_report", "Open Shipment Report", "XLS");

	public final int type;
	public final String name;
	public final String title;
	public final String abbreviation;
	private final boolean hasPdfVersion;
	private final boolean hasOptionalFields;


	ReportType(int type, String name, String title, String abbreviation) {
		this.type = type;
		this.name = name;
		this.title = title;
		this.abbreviation = abbreviation;
		this.hasPdfVersion = false;
		this.hasOptionalFields = false;
	}
	
	ReportType(int type, String name, String title, String abbreviation, boolean hasPdfVersion, boolean hasOptionalFields) {
		this.type = type;
		this.name = name;
		this.title = title;
		this.abbreviation = abbreviation;
		this.hasPdfVersion = hasPdfVersion;
		this.hasOptionalFields = hasOptionalFields;
	}

	public static ReportType getObjectByType(int type) {
		return ReportType.values()[type - 1];
	}

	public Object getObjectId() {
		return type;
	}

	public String getObjectName() {
		return name;
	}

	public int getType() {
		return type;
	}

	public String getName() {
		return name;
	}

	public String getTitle() {
		return title;
	}

	public String getAbbreviation() {
		return abbreviation;
	}

	public boolean isHasPdfVersion() {
		return hasPdfVersion;
	}
	
	public boolean isHasOptionalFields() {
		return hasOptionalFields;
	}
}
